import { useTable, LIST_TYPE } from '@crud/index';
import { getLecBindList } from '@/api/crm-agency/kgj/lecturer';

// 查询
export const statusOptions = [
  { label: '不限', value: 0 },
  { label: '绑定中', value: 1 },
  { label: '已失效', value: 2 }
];
export const renewalOptions = [
  { label: '不限', value: 0 },
  { label: '是', value: 1 },
  { label: '否', value: 2 }
];
export const renewalMap: Record<string, any> = { 0: '不限', 1: '是', 2: '否' };
export const usedMap: Record<string, any> = { 1: '绑定中', 0: '已失效' };
// 表格
export const useTableList = (options: any = {}) => {
  const columns: any = [
    { label: '账号名称', prop: 'nick_name', minWidth: 160, render: 'nick_name' },
    { label: '手机号', prop: 'mobile', minWidth: 120, render: 'mobile' },
    { label: '绑定时间', prop: 'bind_time', minWidth: 160, render: 'bind_time' },
    { label: '绑定状态', prop: 'usedText', minWidth: 120, render: 'usedText' },
    { label: '到期时间', prop: 'statusText', minWidth: 160, render: 'statusText' },
    { label: '是否续费', prop: 'isRenewalText', minWidth: 120, render: 'isRenewalText' },
    { label: '续费次数', prop: 'renewal_cnt', minWidth: 120, render: 'renewal_cnt' }
  ];

  return useTable({
    ...options,
    type: LIST_TYPE.AGENCY,
    params: {
      agent_id: undefined,
      keyword: undefined,
      status: undefined,
      renewal: undefined
    },
    columns: columns,
    getList: getLecBindList
  });
};
